package com.fm.openinstall.c;

import java.net.*;
import java.util.*;
import java.io.*;
import javax.net.ssl.*;
import java.security.*;
import java.security.cert.*;
import android.content.*;
import android.support.annotation.*;
import android.net.*;

public class d
{
    public static String a(final InputStream inputStream) {
        final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "utf-8"));
        final StringBuilder sb = new StringBuilder();
        while (true) {
            final String line = bufferedReader.readLine();
            if (line == null) {
                break;
            }
            sb.append(line);
        }
        bufferedReader.close();
        return sb.toString();
    }

    public static String a(final Map map) {
        if (map == null) {
            return "";
        }
        final StringBuilder sb = new StringBuilder();
        for (final Map.Entry<String, V> entry : map.entrySet()) {
            sb.append(URLEncoder.encode(entry.getKey(), "utf-8"));
            sb.append("=");
            String s;
            if (entry.getValue() == null) {
                s = "";
            }
            else {
                s = (String)entry.getValue();
            }
            sb.append(URLEncoder.encode(s, "utf-8"));
            sb.append("&");
        }
        String s3;
        final String s2 = s3 = sb.toString();
        if (s2.length() > 0) {
            s3 = s2.substring(0, s2.length() - 1);
        }
        return s3;
    }

    public static SSLSocketFactory a() {
        final CertificateFactory instance = CertificateFactory.getInstance("X.509");
        Object o = new ByteArrayInputStream("-----BEGIN CERTIFICATE-----\nMIIFVzCCBD+gAwIBAgIQKcbn9H4YDykqMg6fnb5n2jANBgkqhkiG9w0BAQsFADCB\nkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\nA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNjA0BgNV\nBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD\nQTAeFw0xNzAzMTYwMDAwMDBaFw0xODAzMTYyMzU5NTlaMF0xITAfBgNVBAsTGERv\nbWFpbiBDb250cm9sIFZhbGlkYXRlZDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls\nZGNhcmQxGTAXBgNVBA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3QBN39bSsHNA7qxcS1u80GH4r6XnTq1dFDK8o+tDb5VCViLvfhVdpfZLY\nUspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5\nB5a6SE2Q8pTIqXOi6wZ7I53eovNNVZ96YUWYGGjHXkBrI/V5eu+MtWuLt29G9Hvx\nPUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR\npu/xO28QOG8=\n-----END CERTIFICATE-----".getBytes("utf-8"));
        try {
            final Certificate generateCertificate = instance.generateCertificate((InputStream)o);
            ((InputStream)o).close();
            o = KeyStore.getInstance(KeyStore.getDefaultType());
            ((KeyStore)o).load(null, null);
            ((KeyStore)o).setCertificateEntry("ca", generateCertificate);
            final TrustManagerFactory instance2 = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
            instance2.init((KeyStore)o);
            o = SSLContext.getInstance("TLS");
            ((SSLContext)o).init(null, instance2.getTrustManagers(), null);
            return ((SSLContext)o).getSocketFactory();
        }
        finally {
            ((InputStream)o).close();
        }
    }

    public static boolean a(@NonNull final Context context) {
        final ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService("connectivity");
        final boolean b = false;
        if (connectivityManager == null) {
            return false;
        }
        final NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
        boolean b2 = b;
        if (activeNetworkInfo != null) {
            b2 = b;
            if (activeNetworkInfo.isConnectedOrConnecting()) {
                b2 = true;
            }
        }
        return b2;
    }
}
